


function submit() {
    // alert(123);
    $.ajax({
        url:url,
        type:"post",
        dataType:"text",
        data:$("#forms").serialize(),
        success:function (data) {
//             alert(data)                                     //测试data
            if(data=="1"){                                 //判断是否成功
                alert("删除成功");
                location.href=locationurl;
            }else{
                alert("删除失败")
            }
        },
        error:function (e) {
            alert(e.response)
        }
    });
}

function changes(id) {
       // alert(id.value);
    $.ajax({
        url: chengeurl,
        type: "post",
        dataType: "json",
        data: {
            name: id.value
        },
        success: function (data) {
//            alert(data[0].record_name)
            $("#select").empty();
            for (var i = 0; i < Object.keys(data).length; i++) {  //获取data长度   循环遍历出来
                $("#select").append('<option value=' + data[i].id + '>' + data[i].record_name + '</option>')
            }
        },
        error: function (e) {
            alert(e.response)
        }
    })
}
$.validator.setDefaults({
    submitHandler: function() {

    }
});

/**
 * Created by Administrator on 2017/7/18.
 */
